import React, { useRef } from 'react'
import { debounce } from '@/utils/index'

export const useDebounce = (fun, wait) => {
    const myRef = useRef();
    if (!myRef.current) {
        myRef.current = debounce(fun, wait)
    }
    return myRef.current;
}